import request from '@/utils/request.js'

// 分页展示某个文章的评论
export const commentPageService = (params) => {
    return request.get('/comment/list',params);
}

// 后台查询最新的几条评论
export const commentNewService = () => {
    return request.get('/comment/getNewComment');
}
// 分页获取所有评论接口
export const commentListService = (params) => {
    return request.get('/comment', { params: params });
}

// 封装添加评论接口
export const commentAddService = (articleModel) => {
    return request.post('/comment/add', articleModel);
}

// 封装修改评论接口
export const commentUpdateService = (articleModel) => {
    return request.post('/comment/update', articleModel);
}

// 封装删除评论接口
export const commentDeleteService = (id) => {
    return request.delete('/comment?id=' + id);
}